package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class WindowPartitionColumnReferenceList {

    private int beginIndex;
    private int endIndex;
    private List<WindowPartitionColumnReference> windowPartitionColumnReferenceList;

    public WindowPartitionColumnReferenceList(List<WindowPartitionColumnReference> windowPartitionColumnReferenceList) {
        this.beginIndex = windowPartitionColumnReferenceList.get(0).getBeginIndex();
        this.endIndex = windowPartitionColumnReferenceList.get(windowPartitionColumnReferenceList.size() - 1).getEndIndex();
        this.windowPartitionColumnReferenceList = windowPartitionColumnReferenceList;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public int size() {
        return windowPartitionColumnReferenceList.size();
    }

    public WindowPartitionColumnReference get(int index) {
        return windowPartitionColumnReferenceList.get(index);
    }

}
